package com.ljwy.showinfo.okgoHelper;

import android.app.Dialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.ljwy.showinfo.R;


/**
 * Created by Sloop on 2018/7/26
 * Description: 通用加载动画
 */
public class LoadingView extends Dialog {

    private String text = null;

    public LoadingView(Context context) {
        super(context, R.style.dialog);
        initView(context);
    }

    public LoadingView(Context context, String text) {
        super(context, R.style.dialog);
        this.text = text;
        initView(context);
    }

    private void initView(Context context) {
        View v = LayoutInflater.from(context).inflate(R.layout.loading_layout, null);
        ImageView Loading = v.findViewById(R.id.gifView);
        TextView loadingText = v.findViewById(R.id.loadingText);
        if (text != null) {
            loadingText.setText(text);
        }
       // GlideManager.displayImageGif(Loading,context);
        setCancelable(true);
        setContentView(v);
    }
}
